package api

import (
	"gitee.com/DengAnbang/Computation/src/code"
	"gitee.com/DengAnbang/Computation/src/bean"

	"io/ioutil"
	"gitee.com/DengAnbang/goutils/fileUtil"
)

/**
	* showdoc
	* @catalog socket文档/认证相关
	* @title 图形核心认证
	* @description 图形核心认证的接口
	* @method socket type=103
	* @url /public/authentication/pcLic
	* @return {"code": 0,"type": 103,"message": "","debug_message": "","data": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n<license>\n    <productname>BIM3DViewer</productname>\n    <productcode>BIM3D-BIM3DViewer</productcode>\n    <productversion>1.0</productversion>\n    <clientname>BIM管理平台</clientname>\n    <clientcomputercode>127CCBE97EDF2C58D9AEFA3A00BDAAB2</clientcomputercode>\n    <startdate>2018/06/26</startdate>\n    <enddate>2018/12/31</enddate>\n    <maxusercount>1</maxusercount>\n    <checkcode>D9E51DF14BCBC8EB21E500DBEC3FE270A19D15303F703783E9B6B7E6EBC3D0F0B25221C1A089B1004E9862272A2D863A13388138F37E3AD72E2A6B4060A7B0DB06BE44B2416CCCC9AA0706F046666A9B98229896D5F3B85FC2EE11F31B37D22052F6A1420EB02D69552D6196188DDC30C685BE024530BE6A2B21CA80724E9FCCF5A7B6EDA4A71408875F84BB24787738B10F12B4D5BF1A05CEFD428468571414468F776E4E050310B4A9FE4B83A13913742749DC9EF7FA02F7FAFB486973C241B484DE9FCEFB706D6099E2E3FF865B69CF83812EE62AC34CC0D9C1A180D827151A30B403232CE9CD80700EE50E6AD63968F7BF31A1F41E59F39BCC497A21114D47C97A1692510B1B15D17AA1A946DF7AE6368ABF3ADD0B8C0BA848EADDE67AFFA2E65A15DECEF11A268650B1F1AF2CBD6D31A1C4010DEEA15C0FF1AD19C3255108E1DE272E50C561C7729C91376EC0594E4A954666472E0A3117BF45DDE76A5049EDAAAEC02E5742696537BE065CEE0BD020F4269EFDBDCC129D3225FAE9ACE5D21A377BBEDEAE4DD8F58AE49AEB0C6CE4648B829C5EC541DF35995DCD06EBB4304304DD6079277CCAB09C49145323EE5CF8193477C6BA531EA1E84F46052A98D2D9895595DBDB574B29B576E45C62918CC23273A1F69078716A5CCBE6BDEC7B806130D0501B0B26F2E8A89B16CA6EDA627B2A438601552AB98832FCB19C4BFC53BB476E642C05D94E381518C564964EB8E9EBC73C302C896F441FC591D1BC25A983FB2869B33D28342F2512948443FDBC98A1FC7635C88911A82ADD23F733EE0ECCA6872BC09F77D98A887E14424E550F75B41E4139B16DF752F24ABB8C07938A0BF55A506B6249EEB28BD4C121F21D77D9B228BB4C279086AA2AB8532C0875FB6FFCEFF447FA300072D71BCF459390FBABF130FC23348DF9932C31105965701C01159977B1EC1C35EDF7A439945C7100C8B2234BA7933AFA344D704CAB16518B115B83E4F10F367503F4F8860D5863622659278C5006CCBD8148E8A448C7B77BEFDB6AFD1298F2EE0A86D0C5FE46211407E4C489DCAA4A080C41C0F4FA0BFBE17571E2C1678035A35A6EE8AD2F3CD7</checkcode>\n</license>\n"}
	* @return_param type int 请求类型
	* @return_param data string lin相关的内容
	* @remark 最后修改时间:2018.12.24 10.30
	* @number 99
	*/
func PCAuthenticationLic(parameters map[string]string) (error) {
	fileName := code.ConfigRootPath + code.PCLinName
	if !fileUtil.PathExists(fileName) {
		return bean.NewErrorMessage("图形核心的lic不存在!")
	}
	bytes, err := ioutil.ReadFile(fileName)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage( string(bytes))
}
